<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./echarts.min.js"></script>
  </head>
  <body>
    <div id="main" style="width: 800px; height: 400px"></div>
    <script>
      var myChart = echarts.init(document.querySelector("#main"));
      const option = {
        title: [
          {
            text: "男女薪资分布",
          },
          {
            subtext: 'alignTo: "none" (default)',
            left: "center",
            top: "45%",
          },
          {
            subtext: 'alignTo: "labelLine"',
            left: "center",
            top: "85%",
          },
        ],
        series: [
          {
            type: "pie",
            radius: ["15%", "20%"],
            center: ["50%", "30%"],
            data: [
              {
                name: "Apples",
                value: 70,
              },
              {
                name: "Strawberries",
                value: 68,
              },
              {
                name: "Bananas",
                value: 48,
              },
              {
                name: "Oranges",
                value: 40,
              },
            ],
            label: {
              position: "outer",
              alignTo: "none",
              bleedMargin: 5,
            },
          },
          {
            type: "pie",
            radius: ["15%", "20%"],
            center: ["50%", "70%"],
            data: [
              {
                name: "Apples",
                value: 70,
              },
              {
                name: "Strawberries",
                value: 68,
              },
              {
                name: "Bananas",
                value: 48,
              },
              {
                name: "Oranges",
                value: 40,
              },
            ],
            label: {
              position: "outer",
              alignTo: "labelLine",
              bleedMargin: 5,
            },
          },
        ],
      };
      // 使用刚指定的配置项和数据显示图表。
      myChart.setOption(option);
    </script>
  </body>
</html>
